﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Windows.Interactivity;
using NicoView.Speech;
using NicoView.Model.Service.Broadcast;
using NicoView.Model.Service;

namespace NicoView.View.Behaviors
{
    //
    // Action のターゲット要素をその親以外にしたい場合、クラスを
    // TriggerAction の代わりに TargetedTriggerAction から拡張します
    //
    public abstract class TagActionBase : TargetedTriggerAction<NicoViewNiconicoTag>
    {
        public TagActionBase()
        {

        }

       
        

        /// <summary>
        /// The <see cref="TargetTags" /> dependency property's name.
        /// </summary>
        public const string TargetTagsPropertyName = "TargetTags";

        /// <summary>
        /// Gets or sets the value of the <see cref="TargetTags" />
        /// property. This is a dependency property.
        /// </summary>
        public NicoViewNiconicoTagCollection TargetTags
        {
            get
            {
                return (NicoViewNiconicoTagCollection)GetValue(TargetTagsProperty);
            }
            set
            {
                SetValue(TargetTagsProperty, value);
            }
        }

        /// <summary>
        /// Identifies the <see cref="TargetTags" /> dependency property.
        /// </summary>
        public static readonly DependencyProperty TargetTagsProperty = DependencyProperty.Register(
            TargetTagsPropertyName,
            typeof(NicoViewNiconicoTagCollection),
            typeof(TagActionBase),
            new UIPropertyMetadata(null));


        protected override void Invoke(object parameter)
        {
            if (this.Target == null || this.TargetTags == null)
            {
                return;
            }

            OnInvoke(parameter);
        }


        protected abstract void OnInvoke(object parameter);
    }
}